﻿using InSafetyAirServer.Database;
using InSafetyAirServer.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using InSafetyAirServer.Controller;

namespace InSafetyAirServer
{
    [ServiceContract]    
    public interface IService
    {
        [OperationContract]
        IList<Path<Airport, Schedule>> searchForFlight(Airport startAirport, Airport endAirport, string criteria, DateTime time, int personsNo, int stops);
        [OperationContract]
        Account createAccount(Person person, string username, string password, string email, byte access);
        [OperationContract]
        OurClass[] GetAll(string type);
        [OperationContract]
        OurClass GetById(string type, int id);
        [OperationContract]
        OurClass AddToDatabase(OurClass obj);
        [OperationContract]
        void UpdateToDatabase(OurClass obj);
        [OperationContract]
        void DeleteFromDatabase(OurClass obj);
        [OperationContract]
        Account checkLogin(string username, string password);
        [OperationContract]
        void updateFlight(Flight f);
        [OperationContract]
        void updateSegment(FlightSegment fs);
        [OperationContract]
        void updateSchedule(Schedule sh);
        [OperationContract]
        void updatePerson(Person p);
        [OperationContract]
        bool makeBooking(int accoundId, List<BookingLine> bookingLines, List<int> schedules, List<Person> persons);
        [OperationContract]
        List<FlightSegment> getFlightSegments(int flightId);
        [OperationContract]
        List<Schedule> getSchedules(int segmentId);
        [OperationContract]
        int getFreeSeats(int scheduleId);

    }
}
